using System;
using System.Data;
using System.Collections;
using System.Collections.Generic;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;


/// <summary>
/// Summary description for CacheItem
/// </summary>
public class CacheItem
{
    public object item;
    private DateTime time;
   
    public object MyObject
    {
        get
        {
            return item;
        }
        set
        {
            item = value;
            this.time = DateTime.Now;
        }
    }
    public bool Isvalid()
    {
        if (time == null)
        {
            return false;
        }
        else
        {
            if (DateTime.Now.AddHours(-2) > time)
                return false;
            else
                return true;
        }
    }
}
